<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@include file="/context/mytags.jsp" %>
<!DOCTYPE html>
<html>
<head>
    <title></title>
    <t:base type="jquery,easyui,tools,DatePicker,ckeditor"></t:base>
    <link rel="stylesheet" href="${webRoot}/plug-in/custom_style/css/style.css"/>
    <link rel="stylesheet" href="${webRoot}/plug-in/lhgDialog/skins/blue.css"/>
    <link rel="stylesheet" href="${webRoot}/plug-in/lhgDialog/skins/default.css"/>
    <script type="text/javascript" src="${webRoot}/plug-in/ajaxfileupload/ajaxfileupload.js"></script>
</head>

<body scroll="no">
<t:formvalid formid="addformobj" dialog="true" usePlugin="password" layout="table"
             action="platformController.do?saveorupdate" beforeSubmit="checkName">
    <input name="platformId" type="hidden" value="${entity.platformId}">

    <div class="new_table_list">
        <table cellpadding="0" cellspacing="0" class="formtable" >
            <tbody>
            <tr>
                <th colspan="2">分平台信息</th>
            </tr>
            <tr>
                <td align="left" style="width: 100px">
                    <label class="Validform_label">
                        分平台名称:
                    </label>
                </td>
                <td class="txt_left value">
                    <input class="inputxt" style="width: 250px;" id="name" name="name" value="${entity.name}" datatype="*"
                           maxlength="128">
                    <span class="Validform_checktip"></span>
                </td>
            </tr>
            <tr>
                <td align="left" style="width: 100px">
                    <label class="Validform_label">
                        分平台编码:
                    </label>
                </td>
                <td class="txt_left value">
                    <input class="inputxt" disabled="disabled" style="width: 250px;" id="platformCode" name="platformCode" value="${entity.platformCode}" datatype="*"
                           maxlength="128">
                    <span class="Validform_checktip"></span>
                </td>
            </tr>
            <tr>
                <td align="left" style="width: 100px">
                    <label class="Validform_label">
                        是否开放:
                    </label>
                </td>
                <td class="txt_left value">
                    <t:dictSelect id="isopen" field="open" typeGroupCode="isno"
                                  defaultVal="${entity.open}" hasLabel="false"></t:dictSelect>
                </td>
            </tr>
        </table>
    </div>
</t:formvalid>
<script type="text/javascript">
    $(function () {
        $("#isopen").children().first().remove();
    });

    function checkName() {
        var id = "${entity.platformId}";//平台id
        var name = $("#name").val();//平台名称
        var url = "platformController.do?checkName";
        var flag = false;
        $.ajax({
            url : url,
            async : false, // 注意此处需要同步
            type : "GET",
            dataType : "json",
            data: {id:id,name:name },
            success : function(data) {
                if(data.code==1){
                    tip(data.msg);
                }else{
                    flag = true;
                }
            }
        });
        return flag;
    }
</script>
</body>

</html>